package com.kude.manager;

import com.kude.dao.ProductCategoryPrefixDAO;
import com.kude.entity.ProductCategoryPrefix;

public class ProductCategoryPrefixManager extends
		AbstractManager<ProductCategoryPrefix, ProductCategoryPrefixDAO> {

	ProductCategoryPrefixDAO productCategoryPrefixDAO;

	public ProductCategoryPrefixManager() {
		this.tableName = ProductCategoryPrefix.TABLE_NAME;
	}

	public boolean isExist(ProductCategoryPrefix obj) throws OperException {
		if (obj == null) {
			throw new OperException("产品类别前缀对象obj不能为空");
		}
		if (obj.getPrefixId() == null) {
			return false;
		}
		if (dao.getById(obj.getPrefixId()) == null) {
			return false;
		}
		return true;
	}

	public void setProductCategoryPrefixDAO(
			ProductCategoryPrefixDAO productCategoryPrefixDAO) {
		this.dao = productCategoryPrefixDAO;
	}

}
